﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ddcCajamarca.BusinessEntities.Directorio;
using System.Data.Entity.ModelConfiguration;
using System.ComponentModel.DataAnnotations.Schema;

namespace ddcCajamarca.Repository.Mapping
{
    public class UbigeoMap : EntityTypeConfiguration<Ubigeo>
    {
        public UbigeoMap()
        {
            this.HasKey<string>(c => c.Id);

            this.Property(c => c.Id)
                .IsRequired()
                .HasColumnType("char")
                .HasMaxLength(6);

            this.Property(c => c.Nombre)
                .HasMaxLength(125)
                .IsRequired();

            this.ToTable("Ubigeo");
            this.Property(c => c.Id).HasColumnName("Id");
            this.Property(c => c.Nombre).HasColumnName("Nombre");
        }
    }
}
